<style>
    body { background: #fff; }
    #table { height: 370px; overflow-y: scroll}
    #table th {}
</style>
<div id="table">
<table class="am-table dux-table-dialog">
    <thead>
    <tr>
        <th width="100">#</th>
        <th>名称</th>
        <th>规格</th>
        <th class="am-text-center" width="120">选择</th>
    </tr>
    </thead>
    <tbody>
    <!--loop{$list as $vo}-->
    <tr>
        <td>{$vo.spec_id}</td>
        <td>{$vo.name}</td>
        <td>{$vo.value}</td>
        <td class="am-text-center">
            <input type="checkbox" class="select" value="{$vo.spec_id}" data-name="{$vo.name}">
        </td>
    </tr>
    <!--{/loop}-->
    </tbody>
</table>
</div>
<div class="dux-dialog-foot">
    <button class="am-btn am-btn-success" type="button" id="add">加入</button>
</div>

<script>
    Do.ready('base', function () {
        $('#add').click(function() {
            var ids = new Array();
            $('#table').find(".select:checked").each(function () {
                ids.push({spec_id:$(this).val(), name:$(this).data('name')});
            });
            window.parent.addSpec(ids);
            parent.dialog.close();
        })
    });
</script>